# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=sliding-sync
pkgver=0.99.10
pkgrel=1
pkgdesc="Matrix protocol sliding sync specification"
url="https://github.com/matrix-org/sliding-sync"
license="Apache-2.0"
arch="all"
makedepends="go"
install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/matrix-org/sliding-sync/archive/v$pkgver.tar.gz
	sliding-sync.initd
	sliding-sync.confd
	"
options="net !check" # check needs a postgres instance

build() {
	go build \
		-v -o syncv3 ./cmd/syncv3
}

package() {
	install -Dm755 syncv3 "$pkgdir"/usr/bin/syncv3

	install -Dm755 "$srcdir"/sliding-sync.initd "$pkgdir"/etc/init.d/sliding-sync
	install -Dm644 "$srcdir"/sliding-sync.confd "$pkgdir"/etc/conf.d/sliding-sync
}

sha512sums="
2bb69a34ba21608b44565e5707dc88a98ee7220c1408c4f5fb6cb385a949725011d058d113627df148ad6c1984e157b64ce6c0fe37d477f3451abb3de4828b86  sliding-sync-0.99.10.tar.gz
1eb41f4a4731d775c3f45b735515c297bc80f9a8934736915d430dcb0ca311aefe357bb33785da69923488d0eb6569b8466550df80395169ddafe8e9887e4566  sliding-sync.initd
cc525d6027e244a4c54dbfee8baaf83a842b61462a1e478d57a9a9d7f1fa7efe92d3930aae52cb4433dd0422e1b176c10cfd2b0ac75cbde94bbe1647ca79ba32  sliding-sync.confd
"
